3.1.75 \(\int (e x)^{-1+n} (a+b \sec (c+d x^n))^2 \, dx\) [75]

Optimal. Leaf size=79 \[ \frac {a^2 (e x)^n}{e n}+\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}+\frac {b^2 x^{-n} (e x)^n \tan \left (c+d x^n\right )}{d e n} \]

[Out]

a^2*(e*x)^n/e/n+2*a*b*(e*x)^n*arctanh(sin(c+d*x^n))/d/e/n/(x^n)+b^2*(e*x)^n*tan(c+d*x^n)/d/e/n/(x^n)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4293, 4289, 3858, 3855, 3852, 8} \begin {gather*} \frac {a^2 (e x)^n}{e n}+\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}+\frac {b^2 x^{-n} (e x)^n \tan \left (c+d x^n\right )}{d e n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(e*x)^(-1 + n)*(a + b*Sec[c + d*x^n])^2,x]

[Out]

(a^2*(e*x)^n)/(e*n) + (2*a*b*(e*x)^n*ArcTanh[Sin[c + d*x^n]])/(d*e*n*x^n) + (b^2*(e*x)^n*Tan[c + d*x^n])/(d*e*
n*x^n)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3858

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Simp[a^2*x, x] + (Dist[2*a*b, Int[Csc[c + d*x], x],
 x] + Dist[b^2, Int[Csc[c + d*x]^2, x], x]) /; FreeQ[{a, b, c, d}, x]

Rule 4289

Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Sec[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rule 4293

Int[((e_)*(x_))^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[e^IntPart[m]*((e*x
)^FracPart[m]/x^FracPart[m]), Int[x^m*(a + b*Sec[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]

Rubi steps

\begin {align*} \int (e x)^{-1+n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx &=\frac {\left (x^{-n} (e x)^n\right ) \int x^{-1+n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx}{e}\\ &=\frac {\left (x^{-n} (e x)^n\right ) \text {Subst}\left (\int (a+b \sec (c+d x))^2 \, dx,x,x^n\right )}{e n}\\ &=\frac {a^2 (e x)^n}{e n}+\frac {\left (2 a b x^{-n} (e x)^n\right ) \text {Subst}\left (\int \sec (c+d x) \, dx,x,x^n\right )}{e n}+\frac {\left (b^2 x^{-n} (e x)^n\right ) \text {Subst}\left (\int \sec ^2(c+d x) \, dx,x,x^n\right )}{e n}\\ &=\frac {a^2 (e x)^n}{e n}+\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}-\frac {\left (b^2 x^{-n} (e x)^n\right ) \text {Subst}\left (\int 1 \, dx,x,-\tan \left (c+d x^n\right )\right )}{d e n}\\ &=\frac {a^2 (e x)^n}{e n}+\frac {2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}+\frac {b^2 x^{-n} (e x)^n \tan \left (c+d x^n\right )}{d e n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.41, size = 54, normalized size = 0.68 \begin {gather*} \frac {x^{-n} (e x)^n \left (a^2 d x^n+2 a b \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )+b^2 \tan \left (c+d x^n\right )\right )}{d e n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(e*x)^(-1 + n)*(a + b*Sec[c + d*x^n])^2,x]

[Out]

((e*x)^n*(a^2*d*x^n + 2*a*b*ArcTanh[Sin[c + d*x^n]] + b^2*Tan[c + d*x^n]))/(d*e*n*x^n)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.86, size = 276, normalized size = 3.49

method result size
risch \(\frac {a^{2} x \,{\mathrm e}^{\frac {\left (-1+n \right ) \left (-i \mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right ) \pi +i \mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )^{2} \pi +i \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )^{2} \pi -i \mathrm {csgn}\left (i e x \right )^{3} \pi +2 \ln \left (e \right )+2 \ln \left (x \right )\right )}{2}}}{n}+\frac {2 i x \,b^{2} {\mathrm e}^{\frac {\left (-1+n \right ) \left (-i \mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right ) \pi +i \mathrm {csgn}\left (i e \right ) \mathrm {csgn}\left (i e x \right )^{2} \pi +i \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i e x \right )^{2} \pi -i \mathrm {csgn}\left (i e x \right )^{3} \pi +2 \ln \left (e \right )+2 \ln \left (x \right )\right )}{2}} x^{-n}}{d n \left (1+{\mathrm e}^{2 i \left (c +d \,x^{n}\right )}\right )}-\frac {4 i \arctan \left ({\mathrm e}^{i \left (c +d \,x^{n}\right )}\right ) e^{n} b a \,{\mathrm e}^{\frac {i \pi \,\mathrm {csgn}\left (i e x \right ) \left (-1+n \right ) \left (\mathrm {csgn}\left (i e x \right )-\mathrm {csgn}\left (i x \right )\right ) \left (-\mathrm {csgn}\left (i e x \right )+\mathrm {csgn}\left (i e \right )\right )}{2}}}{d e n}\) \(276\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x)^(-1+n)*(a+b*sec(c+d*x^n))^2,x,method=_RETURNVERBOSE)

[Out]

a^2/n*x*exp(1/2*(-1+n)*(-I*csgn(I*e)*csgn(I*x)*csgn(I*e*x)*Pi+I*csgn(I*e)*csgn(I*e*x)^2*Pi+I*csgn(I*x)*csgn(I*
e*x)^2*Pi-I*csgn(I*e*x)^3*Pi+2*ln(e)+2*ln(x)))+2*I*x*b^2*exp(1/2*(-1+n)*(-I*csgn(I*e)*csgn(I*x)*csgn(I*e*x)*Pi
+I*csgn(I*e)*csgn(I*e*x)^2*Pi+I*csgn(I*x)*csgn(I*e*x)^2*Pi-I*csgn(I*e*x)^3*Pi+2*ln(e)+2*ln(x)))/d/n/(x^n)/(1+e
xp(2*I*(c+d*x^n)))-4*I*arctan(exp(I*(c+d*x^n)))/d/e*e^n/n*b*a*exp(1/2*I*Pi*csgn(I*e*x)*(-1+n)*(csgn(I*e*x)-csg
n(I*x))*(-csgn(I*e*x)+csgn(I*e)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+n)*(a+b*sec(c+d*x^n))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(n-1>0)', see `assume?` for mor
e details)Is

________________________________________________________________________________________

Fricas [A]
time = 2.94, size = 109, normalized size = 1.38 \begin {gather*} \frac {a^{2} d x^{n} \cos \left (d x^{n} + c\right ) e^{\left (n - 1\right )} + a b \cos \left (d x^{n} + c\right ) e^{\left (n - 1\right )} \log \left (\sin \left (d x^{n} + c\right ) + 1\right ) - a b \cos \left (d x^{n} + c\right ) e^{\left (n - 1\right )} \log \left (-\sin \left (d x^{n} + c\right ) + 1\right ) + b^{2} e^{\left (n - 1\right )} \sin \left (d x^{n} + c\right )}{d n \cos \left (d x^{n} + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+n)*(a+b*sec(c+d*x^n))^2,x, algorithm="fricas")

[Out]

(a^2*d*x^n*cos(d*x^n + c)*e^(n - 1) + a*b*cos(d*x^n + c)*e^(n - 1)*log(sin(d*x^n + c) + 1) - a*b*cos(d*x^n + c
)*e^(n - 1)*log(-sin(d*x^n + c) + 1) + b^2*e^(n - 1)*sin(d*x^n + c))/(d*n*cos(d*x^n + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (e x\right )^{n - 1} \left (a + b \sec {\left (c + d x^{n} \right )}\right )^{2}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)**(-1+n)*(a+b*sec(c+d*x**n))**2,x)

[Out]

Integral((e*x)**(n - 1)*(a + b*sec(c + d*x**n))**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+n)*(a+b*sec(c+d*x^n))^2,x, algorithm="giac")

[Out]

integrate((b*sec(d*x^n + c) + a)^2*(e*x)^(n - 1), x)

________________________________________________________________________________________

Mupad [B]
time = 2.71, size = 180, normalized size = 2.28 \begin {gather*} \frac {a^2\,x\,{\left (e\,x\right )}^{n-1}}{n}+\frac {b^2\,x\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}}{d\,n\,x^n\,\left ({\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x^n\,2{}\mathrm {i}}+1\right )}+\frac {2\,a\,b\,x\,\ln \left (-a\,b\,{\left (e\,x\right )}^{n-1}\,4{}\mathrm {i}-4\,a\,b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\right )\,{\left (e\,x\right )}^{n-1}}{d\,n\,x^n}-\frac {2\,a\,b\,x\,\ln \left (a\,b\,{\left (e\,x\right )}^{n-1}\,4{}\mathrm {i}-4\,a\,b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\right )\,{\left (e\,x\right )}^{n-1}}{d\,n\,x^n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/cos(c + d*x^n))^2*(e*x)^(n - 1),x)

[Out]

(a^2*x*(e*x)^(n - 1))/n + (b^2*x*(e*x)^(n - 1)*2i)/(d*n*x^n*(exp(c*2i + d*x^n*2i) + 1)) + (2*a*b*x*log(- a*b*(
e*x)^(n - 1)*4i - 4*a*b*exp(c*1i)*exp(d*x^n*1i)*(e*x)^(n - 1))*(e*x)^(n - 1))/(d*n*x^n) - (2*a*b*x*log(a*b*(e*
x)^(n - 1)*4i - 4*a*b*exp(c*1i)*exp(d*x^n*1i)*(e*x)^(n - 1))*(e*x)^(n - 1))/(d*n*x^n)

________________________________________________________________________________________